home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3072 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.4 KB

  1. Path: news.cc.uic.edu!sunphy1!olczyk
  2. From: olczyk@sunphy1 (Constantin Rasinariu)
  3. Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
  4. Subject: Re: C++ with Zapp vs. Delphi
  5. Followup-To: comp.lang.c++,comp.lang.pascal.delphi.misc
  6. Date: 22 Jan 1996 02:26:39 GMT
  7. Organization: University of Illinois at Chicago
  8. Message-ID: <4duskv$2r54@tigger.cc.uic.edu>
  9. References: <4coar6$d4n@sun4.bham.ac.uk> <4coip7$69s@news1.usa.pipeline.com> <DBk8wg2yqjbB083yn@iaccess.za> <4d7pmb$48c8@tigger.cc.uic.edu> <4dk38h$gdr@merlin.delphi.com> <4dksp1$3d6c@tigger.cc.uic.edu> <4dn30q$o7s@fountain.mindlink.net>
  10. NNTP-Posting-Host: sunphy1.phy.uic.edu
  11. X-Newsreader: TIN [version 1.2 PL2]
  12.  
  13. Brent Bysouth (brent_bysouth@mindlink.bc.ca) wrote:
  14. : a) messaging:
  15.  
  16. : retcode := object.Dispatch(msgCompareTo);
  17.  
  18. : - where msgCompareTo is a message type that you defined, and the
  19. : CompareTo method is declared as message method in the contained
  20. : classes.  Note that this is how control components in Delphi handle
  21. : messages from Windows.
  22. If Dispatch works the way I believe it does then 
  23. it is unreliable (although the method I'm thinking of may not be Dispatch
  24. in which case...).
  25. If Dispatch does not then it is poorly documented.
  26.  
  27. : b) MethodAddress:
  28.  
  29. : var
  30. :   compareTo: TMethod;
  31. : begin
  32.  
  33. :     compareTo.Data := object;
  34. :     compareTo.Code := object.MethodAddress('CompareTo');
  35. :     if compareTo.Code <> nil then
  36. :         retcode := TCompareTo(compareTo) ( {params} );
  37.  
  38. : end;
  39.  
  40. MethodAddress is extremely poorly documented.
  41.  
  42. : -----------
  43.  
  44. : It's not as elegant as other languages (Smalltalk comes to mind), but
  45. : it works.  At some time I may be completing a package that makes all
  46. : of this more transparent, but there probably won't be a need as Delphi
  47. : 2.0 apparently supports dynamically typed types...
  48. If so then my arguement is moot (since it was against a statically typed
  49. SI language ). Unfortunately dynamic typing means that Object Pascal
  50. leads to typing strategies that are weaker then those in C++ ( another
  51. arguement for another time ). It is strange that the roles become reversed
  52. from their parent language. IMO, if Borland was going to use a Pascal
  53. derivative for Delphi, it should have been Eiffel.
  54. ------------------------
  55. Thaddeus L. Olczyk
  56. PS Due to an accident with a minivan, I won't be able to continue this thread.
  57. I have not forgotten that I owe you an example of MI and will provide
  58. when I am well (assuming this thread is is still going).
  59.  
  60.  
  61.